package lab01;

import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        int i;
        int unit;
        int decade;
        int hundreds;
        int kilobit;
        Scanner t=new Scanner(System.in);
        i=t.nextInt();
        if(i >= 1 && i <= 9999){

            kilobit = i / 1000;
            hundreds = (i%1000)/100;
            decade = (i%100)/10;
            unit = i%10;
            if(kilobit != 0 ){
                System.out.println(i+"是四位数");
                if(unit == kilobit && decade == hundreds){
                    System.out.println(i+"是回文数");
                }else{
                    System.out.println(i+"不是回文数");
                }
            }

            else if(kilobit == 0 && hundreds !=0){
                System.out.println("是一个三位数"+i);
                if(unit == hundreds){
                    System.out.println("是回文数"+i);
                }
                else{
                    System.out.println("不是回文数"+i);
                }
            }

            else if(decade != 0){
                System.out.println("是一个两位数"+i);
                if(unit == decade){
                    System.out.println("是回文数"+i);
                }else {
                    System.out.println("不是回文数"+i);
                }
            }

            else if(unit !=0){
                System.out.println("是一个一位数"+i);
                System.out.println("不是回文数"+i);
            }
        }
        else{
            System.out.println(i+"不是有效的数字");
        }

    }
}
